back = imread('background19.jpg');
fore = imread('foreground0.jpg');
figure;imshow(back);
figure;imshow(fore);

 result = back(:,:,:) - fore(:,:,:);
  result = imsubtract(result,20);
 result = NegPic(result);
 result = im2bw(result, 0.5);
figure; imshow(result); title('Output');

